<?php
namespace Api\Model;
use Think\Model;

class AdminModel extends Model {
	private $_db='';
	public function __construct(){
		$this->_db=M('admin');
	}
	public function getAdminByUsername($username) {
		$ret =	$this->_db->where('username="'.$username.'"')->find();
		return $ret;
	}
	
	public function getUserById($id){
		if(!$id || !is_numeric($id)){
			return array();
		}
		$ret = $this->_db->where('admin_id="'.$id.'"')->find();
		return $ret;
	}
}